import Vue from "vue";
import Confirm from "./Confirm.vue";
let confirmConstructor = Vue.extend(Confirm);
let install = function(option) {
  console.log(option);
  return new Promise((resolve, reject) => {
    let dom = new confirmConstructor({
      el: document.createElement("div"),
    });
    document.body.appendChild(dom.$el);
    dom.option = option;
    dom.isShow = true;
    dom.handleOk  = () => {
      resolve();
      dom.isShow = false;
    };
    dom.handleClose  = () => {
      reject();
      dom.isShow = false;
    };
  });
};
export default install;
